home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 1 / ETO Development Tools 1.iso / Essentials / MacApp Documentation / MacApp AppleLink Messages / MacApp.Tech$ 6⁄8⁄90 / 1395-codegen chokes obj⁄r-Jun90 < prev    next >
Encoding:
Text File  |  1990-06-08  |  1.6 KB  |  58 lines  |  [TEXT/GEOL]

  1. Item forwarded  by  FRED.FORSMAN to SEAGRAVES3
  2.  
  3. Item    8339577                         2-June-90        21:56PDT
  4.  
  5. From:   TERRAN                          Cyberex, Terran Van Wagner,PRT
  6.  
  7. To:     MACDTS                          Macintosh Developer Tech Supt
  8.  
  9. cc:     MACAPP.TECH$                    MacApp Technical
  10.  
  11. Sub:    codegen chokes obj/rec fields
  12.  
  13. There's a problem w/ register usage for Record/Object field dereferencing.
  14. The code came out of a very small method, there were no WITH's around these
  15. lines.
  16. Pascal 3.1 was the compiler.
  17.  
  18. The error:
  19.    ### Register 8..10
  20.    ### Within TCHROMVIEW_BOUNDINGPTTOVIEW (Error 2001): Expression too
  21. complicated, code generator ran out of registers
  22.    ### IC = 128, IN = 84:166
  23.  
  24. Function's args:
  25.        (BoundingPt : VPoint; VAR ViewPt : VPoint)
  26.  
  27. Relevant types:
  28.    fNegOffset  : LongInt;
  29.    fVertZoom   : extended;
  30.    li  : longint;
  31.    extra   : extended;
  32.  
  33. Binary searching led me to this line:
  34.  
  35. A:      ViewPt.v := Num2Longint(fVertZoom * (BoundingPt.v - fNegOffset));
  36.         {  killed codegen }
  37.  
  38. I started by simplifying the math, but that didn't do:
  39.  
  40.         li := BoundingPt.v - fNegOffset;
  41. B:      ViewPt.v := Num2Longint(fVertZoom * li); } { <- This enough to kill?}
  42.  
  43. I decided the problem was too much address indirection,
  44. but a few iterations later this made it past the compiler:
  45.  
  46. C:      extra := fVertZoom * (BoundingPt.v - fNegOffset); { <- but this went }
  47.         ViewPt.v := Num2Longint(extra);
  48.  
  49. So, I'd guess that A needs address registers for 4 elements, and B
  50. enough for 2 elements. However C, which the compiler managed, required 3!
  51.  
  52. What's going on here?
  53.  
  54. Thanks,
  55.  
  56. Terran Van Wagner, A'link TERRAN
  57.  
  58.